package masterjava.common.context;

import masterjava.common.configuration.Setting;
import masterjava.common.logging.MasterLogger;
import masterjava.common.util.Util;

/**
 * @author GKislin
 *         Date: 21.10.2008
 */
public abstract class AppContext {

    protected static final MasterLogger LOGGER = MasterLogger.get(AppContext.class);

    private static AppContext INSTANCE;

    // Global props
    protected AppContext() {
        INSTANCE = this;
        Setting.reset();
    }

//  ---------------------- Overrided methods --------------------------------

//    public abstract IJmsContext getJmsContext(JmsDestination jmsDestination) throws NamingException, JMSException;
//
//    public abstract DataSource getDataSource(Scheme sc) throws Exception;
//
//    public abstract void registerMBean(IStateBean item, String name) throws Exception;
//
//    public abstract void unregisterMBean(IStateBean item, String name);
//
//    public abstract void setResourceRepository(LocalizationRepository resourceRepository);

//  ---------------------- ---------------- --------------------------------

    public static AppContext get() {
        return Util.checkNotNull(INSTANCE);
    }
}
